import java.util.Arrays;

public class Main {
    public static int[] mergeSortedArrays(int[] arr1, int[] arr2) {
        int len1 = arr1.length;
        int len2 = arr2.length;
        int[] result = new int[len1 + len2];
        int i = 0, j = 0, k = 0;

        while (i < len1 && j < len2) {
            if (arr1[i] < arr2[j]) {
                result[k++] = arr1[i++];
            } else {
                result[k++] = arr2[j++];
            }
        }

        while (i < len1) {
            result[k++] = arr1[i++];
        }

        while (j < len2) {
            result[k++] = arr2[j++];
        }

        return result;
    }
    public  int[]  montage(int[] a,int[] b){
        int k = 0;
        int[] array = new int[a.length+b.length];
        for (int i = 0; i < a.length; i++) {
            array[k++] = a[i];

        }
        for (int j = 0; j < b.length; j++) {
            array[k++] = b[j];
        }

        Arrays.sort(array);
        return array;

    }




//    public String againString(String s){
//        for (int i = 0; i < s.length(); i++) {
//           char c = s.charAt(i);
//        }
//
//    }

    public static void main(String[] args) {
        int[] arr1 = {1, 9, 5, 7};
        int[] arr2 = {2, 4, 6, 8};
        Main main = new Main();
        System.out.println(Arrays.toString(main.montage(arr1, arr2)));

        String s = "hello";
        String ret = "";

        for (int i = 0; i < s.length(); i++) {
          char c = s.charAt(i);
          if(!ret.contains(c+"")){
              ret +=c;
          }
        }
        System.out.println(ret);
    }
}